package com.network.service.common;

import com.network.service.entity.User;

import java.util.HashMap;
import java.util.Map;

public class ConvertMapUtils {
    /**
     * 用户信息转Map
     *
     * @param user
     * @return
     */
    public static Map getUserMap(User user) {
        Map map = new HashMap<>();
        if (user != null) {
            map.put("user_uuid", user.getUserUuid());
            map.put("name", user.getName());
            map.put("gender", user.getGender());
            map.put("age", user.getAge());
            map.put("email", user.getEmail());
            map.put("mobile", user.getMobile());
            map.put("create_time", user.getCreateTime().getTime());
            map.put("update_time", user.getUpdateTime().getTime());
        }
        return map;
    }
}
